package com.psy.counseling.controller;

import com.psy.counseling.service.impl.UserServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Author 梁学儒
 * @Date 2022/6/3 10:00
 * @Version 1.0
 */
@CrossOrigin //允许跨域请求
@Controller
@Slf4j
public class WelcomeController {

    @Resource
    private UserServiceImpl userService;

    @RequestMapping("/user/checkCode/{code}")
    public String index(@PathVariable("code") String code){
        userService.activation(code);
        return "welcome";
    }
}
